This module helps you display standard alert box's using the toolbox function "StandardAlert".
Benefits of this module
- Easy to use.
- Autoscaling of dialog, textfields and buttons.
- Your alerts look like they should.
Limitations
- No support movable alerts.
- No support help icons.
- The label and narrative strings can hold max. 255 characters.
Requirements
- MacOS 8.+
- REALbasic 2.1+
Methods
NoteAlert( label as string , narrative as string ) as integer
Displays an alert with a talking face icon and an OK button.
label - short, simple summary of the error or condition which summoned the alert.
narrative - more detailed description of the situation and its consequences.
return value - Possible value are: -1 = error ; 1 = everything is ok.
CautionAlert( label as string , narrative as string , defaultCaption, cancelCaption, otherCaption) as integer
Displays an alert with a triangle an OK and a Cancel button ( + an optional third button )
label- short, simple summary of the error or condition which summoned the alert.
narrative - more detailed description of the situation and its consequences.
defaultCaption - the caption of the default button (1). If left blank the current systems default default string is used.
cancelCaption - the caption of the cancel button (3). If left blank the current systems default cancel string is used.
otherCaption - the caption of the cancel button. If left blank this button will not appear.
return value - Returns the id of the pressed button. Possible value are: 0 = error ; 1 = button one ( the default button ) ; 2 = button two ( the cancel button ) ; 3 = button three
StopAlert( label as string , narrative as string ) as integer
Displays an alert with a stop icon and an OK button
label - short, simple summary of the error or condition which summoned the alert.
narrative - more detailed description of the situation and its consequences.
return value - Possible value are: -1 = error ; 1 = everything is ok.
CustomAlert(alertType as integer, label as string, narrative as string, defaultCaption as string, cancelCaption as string, otherCaption as string, defaultButton as integer, cancelButton as integer) as integer
label - short, simple summary of the error or condition which summoned the alert.
narrative - more detailed description of the situation and its consequences.
defaultCaption - the caption of the default button 1. If left blank the current systems default default string is used.
cancelCaption - the caption of the cancel button 2. If left blank the current systems default cancel string is used.
otherCaption - the caption of the cancel button. If left blank this button will not appear.
defaultButton - Specifies which button acts as the default button*
cancelButton - Specifies which button acts as the cancel button*
return value - Possible value are: -1 = error ; 1 = everything is ok.
[*]
Possible values are 1, 2 and 3 ( counting from right to left ).
-----------------------------------------
If you find any bugs or make any changes to this module
please notify me so that everyone can benefit from it.